//
//  HomeDaoHangCollectionViewCell.m
//  GiftSay
//
//  Created by apple on 16/1/10.
//  Copyright © 2016年 liyinkai. All rights reserved.
//

#import "HomeDaoHangCollectionViewCell.h"

@interface HomeDaoHangCollectionViewCell ()

@end

@implementation HomeDaoHangCollectionViewCell
-(instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        self.name = [[UILabel alloc] initWithFrame:CGRectZero];
        self.name.textAlignment = NSTextAlignmentCenter;
        self.name.font = [UIFont systemFontOfSize:14 * SCREEN_WIDTH];
        [self addSubview:self.name];
        
        self.bottom = [[UIView alloc] initWithFrame:CGRectZero];
        self.bottom.backgroundColor = [UIColor whiteColor];
        [self addSubview:self.bottom];
    }
    return self;
}

-(void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes {
    self.name.frame = CGRectMake(0, 0, self.width, self.height - 3);
    self.bottom.frame = CGRectMake(0, self.name.height, self.width, 3);
}

-(void)setModel:(HomeDaoHangModel *)model {
    _model = model;
    self.name.text = _model.name;
}

@end
